/* ベース設定 */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  overflow: hidden;
  background-color: #f8f9fa;
  box-sizing: border-box;
}

#logo-footer {
  position: fixed;
  bottom: 0;
  height: 7dvh;
  width: 100%;
  background-color: #ffffff;
  border-top: 0.0625rem solid #ddd; /* 1px */
  z-index: 9999;
}

#logo-overlay {
  position: absolute;
  top: 0.5rem;       /* 上に配置 */
  right: 0.5rem;     /* 右に配置 */
  z-index: 20;
  opacity: 0.80;
  /* pointer-events: none; */
}

#logo-overlay img {
  height: 3.125rem;
  width: auto;
  object-fit: contain;
}

#logo-top-left {
  height: 2.5rem;
  width: auto;
  object-fit: contain;
}

#lang-bar {
  position: relative;
  z-index: 10;
  height: 3rem; /* 高さ固定で安定した中央表示 */
}

/* 🌊 ビーチ名中央表示（言語と重ならないように中央配置） */
#beach-name-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  font-weight: bold;
  font-size: 1rem;
  z-index: 1;
}

/* 言語リンク右側配置の調整 */
#lang-bar .text-end {
  position: relative;
  z-index: 2;
  min-width: 7rem; /* ⛳ ビーチ名と重ならないよう余白確保 */
}

/* モーダル */
.modal-content {
  border-radius: 1rem;
  padding: 1rem;
}

.tab-content {
  padding: 1rem 1.25rem;
}

.modal-dialog {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.intro-img {
  max-width: 100%;
  border-radius: 0.625rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 0.625rem rgba(0, 0, 0, 0.2);
}

.intro-text {
  font-size: 1.25rem;
}

/* AR表示エリア */
#arContainer {
  position: relative;
  height: 75dvh;
  width: 100%;
  overflow: hidden;
}

a-scene {
  height: 100% !important;
  width: 100% !important;
}

/* オブジェクトカード（横スクロール） */
#object-scroll {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 0.5rem;
  padding: 0 1rem;
  padding-bottom: 10dvh;
  scroll-padding: 0.7rem;
  margin-top: 0.5rem;
  position: relative;
  z-index: 5;
  width: 100vw;
  box-sizing: border-box;
}

#object-scroll .card {
  flex: 1 0 auto;
  width: clamp(10rem, 80vw, 15rem);
  scroll-snap-align: start;
  flex-shrink: 0;
  word-wrap: break-word;
  max-height: 12.5rem;
  overflow: hidden;
  padding: 0.5rem;
}

.card-body {
  padding: 0.5rem !important;
}

.card-title {
  font-size: 1rem;
  white-space: normal;
}

.card-description {
  line-height: 1.3 !important;
  font-size: 0.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  color: #333;
}

.hidden {
  display: none !important;
}


/* 現在地表示 */
#location-display {
  z-index: 10;
  position: absolute;
  top: 0;
  left: 0;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 0.5rem 1rem;
  max-width: 90vw;
  overflow-wrap: break-word;
  font-size: 0.875rem;
  display: none;
}

/* 言語切替 */
.lang-link {
  cursor: pointer;
  font-weight: normal;
  text-decoration: none;
}

.lang-selected {
  font-weight: bold;
  text-decoration: underline;
}

#arContainer.fullscreen-ar {
  /* height: calc(100dvh - 7dvh - 3rem); 言語バーとfooterを除いた高さ */
}
#object-scroll.hidden {
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: visibility 0.3s, opacity 0.3s;
}

#arContainer canvas,
#arContainer video {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  object-fit: cover !important;  
  z-index: 0;
}



/* モバイル縦画面対応 */
@media (max-width: 768px) and (orientation: portrait) {
  #arContainer {
    height: 57dvh;
  }

  #object-scroll {
    height: 30dvh;
    padding-bottom: calc(3dvh + 1rem);
  }

  #location-display {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }

  #logo-overlay img {
    height: 3rem;
  }
  
  #logo-top-left {
    height: 2rem;
  }

  #object-scroll .card {
    width: 50vw;
    max-height: 13.75rem;
  }

  .card-description {
    font-size: 0.7rem;
    -webkit-line-clamp: 4;
  }

  #beach-name-display {
    top: 35%; /* 少し上に */
    font-size: 0.8rem;
    max-width: 48vw;
  }

  #lang-bar .text-end {
    min-width: 7.5rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }
}

/* iPhone SE向け */
@media (max-width: 390px) and (orientation: portrait) {
  #object-scroll .card {
    width: 70vw;
  }

  .card-description {
    -webkit-line-clamp: 2;
    font-size: 0.7rem;
  }

  .card-title {
    font-size: 0.85rem;
  }

  #arContainer.fullscreen-ar {
    /* height: calc(100dvh - 7dvh - 3rem); */
  }
}

/* 横向きロック */
@media screen and (orientation: landscape) {
  body::before {
    content: '縦向きでご利用ください';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    line-height: 100vh;
    z-index: 9999;
  }

  #mainContent {
    display: none !important;
  }
}

video[autoplay][playsinline] {
  display: none !important;
}

#lang-bar {
  background-color: white !important;
  z-index: 1000; /* カメラより前に出す */
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* お好みで影も追加 */
}
